package chain_of_responsibility

import "fmt"

// Reception 具体处理者
type Reception struct {
	next department
}

func (r *Reception) Execute(p *Patient) {
	if p.registrationDone {
		fmt.Println("Patient registration already done.")
		r.next.Execute(p)
		return
	}
	fmt.Println("Reception registering Patient")
	p.registrationDone = true
	r.next.Execute(p)
}

func (r *Reception) SetNext(d department) {
	r.next = d
}

